package com.shop.loan.controller;

import com.shop.loan.annotation.LoginAuth;
import com.shop.loan.model.common.Constant;
import com.shop.loan.model.common.ResResult;
import com.shop.loan.model.vo.FeedbackVo;
import com.shop.loan.service.FeedbackService;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;

@Api(value = "意见反馈", tags = "意见反馈")
@RestController
@RequestMapping(Constant.appPrefex + "/feedback")
public class FeedbackController {

    @Resource
    FeedbackService feedbackService;

    @LoginAuth
    @ApiOperation("提交")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "content", value = "反馈内容", dataType = "int", required = true),
            @ApiImplicitParam(name = "attachment", value = "附件。多个请用|分割，文件名前面加/", dataType = "int", required = true),
            @ApiImplicitParam(name = "type", value = "1：产品建议  2：功能bug  3：内容修正  99：其他", dataType = "int", required = true),
    })
    @ApiResponses({
            @ApiResponse(code = 1, message = "成功")
    })
    @PostMapping("/add")
    public ResResult list(@ApiIgnore FeedbackVo feedbackVo) {
        return feedbackService.add(feedbackVo);
    }

}
